<template>
  <div class="my-counter">
    <button @click="subFn" type="button" class="btn btn-light">-</button>
    <input disabled type="number" class="form-control inp" :value="count" />
    <button @click="addFn" type="button" class="btn btn-light">+</button>
  </div>
</template>

<script>
export default {
  props: ['count', 'id'],
  methods: {
    subFn() {
      this.$emit('subFn', this.id)
      // console.log(this.id)
    },
    addFn() {
      this.$emit('addFn', this.id)
    }
  }
}
</script>

<style lang="less" scoped>
.my-counter {
  display: flex;
  .inp {
    width: 45px;
    text-align: center;
    margin: 0 10px;
  }
  .btn,
  .inp {
    transform: scale(0.9);
  }
}
</style>
